home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / pcplus2.zip / TEF.ASP < prev    next >
Text File  |  1988-01-01  |  3KB  |  83 lines

  1. ;*************************************************************************
  2. ;* TEF.ASP  (C) 1987 DATASTORM TECHNOLOGIES, INC.                        *
  3. ;*                                                                       *
  4. ;* A sample ASPECT script file for PROCOMM PLUS to demonstrate simple    *
  5. ;* time and string handling functions, as well as general ASPECT         *
  6. ;* commands and structure                                                *
  7. ;*                                                                       *
  8. ;*************************************************************************
  9. ;
  10. ; Clear the screen and paint the initial window. (A color monitor is
  11. ; assumed.)
  12. ;
  13.    CLEAR 30                                     ; clear the screen
  14.    CUROFF                                       ; turn off cursor
  15.    BOX 0 0 23 79 30                             ; draw a box
  16.    ATSAY 1 32 30 ">>> TEF.ASP <<<"
  17.    ATSAY 2 20 31 "A sample command file for timed execution"
  18.    ATSAY 22 15 30 "Copyright (C) 1987 DATASTORM TECHNOLOGIES, INC."
  19.    ATSAY 6 5 31 ".ASP file to execute:"
  20.    ATSAY 8 10 31 "Time to execute:       (HH:MM in 24 hour format) "
  21.  
  22. ;
  23. ; prompt for filename to execute
  24. ;
  25. GETCMD:
  26.    ATGET 6 27 113 12 S0                         ; get the filename
  27.    ISFILE S0                                    ; does it exist ?
  28.    IF FAILURE                                   ; if not, add extension
  29.       STRCAT S0 ".ASP"                          ; and look some more
  30.       ISFILE S0
  31.       IF FAILURE                                ; if still not found
  32.          SOUND 200 50                           ; beep, error msg and
  33.          ATSAY 6 40 32 "** File not found **"   ; try again
  34.          PAUSE 2
  35.          SCROLL 0 6 40 6 59 31                  ; clear error message
  36.          GOTO GETCMD
  37.       ENDIF
  38.    ENDIF
  39.  
  40. ;
  41. ; prompt for time to execute
  42. ;
  43. GETTIME:                                        ; got the file, get the time
  44.    ATGET 8 27 113 5 S1
  45.    FIND S1 ":"                                  ; check for a colon
  46.    IF NOT FOUND                                 ; it's a cludgey error check
  47.       SOUND 200 50                              ; but what the heck
  48.       ATSAY 8 59 32 "** Invalid time **"
  49.       PAUSE 2
  50.       SCROLL 0 8 59 8 76 31                     ; clear error message
  51.       GOTO GETTIME
  52.    ENDIF
  53.  
  54. ;
  55. ; Display the waiting prompts
  56. ;
  57.    CLEAR 30
  58.    ATSAY 0 0 31 ">>> TEF.ASP <<<            (C) 1987 DATASTORM TECHNOLOGIES, INC."
  59.    ASSIGN S8 "File: "
  60.    STRCAT S8 S0
  61.    STRCAT S8 " will execute at "
  62.    STRCAT S8 S1
  63.    ATSAY 2 0 31 S8
  64.    STRCAT S1 ":"
  65.    ATSAY 3 0 31 "The current time is:"
  66.  
  67. ;
  68. ; Wait until specified time
  69. ;
  70. SITITOUT:
  71.    TIME S9 1                                    ; get the time
  72.    ATSAY 3 22 31 S9                             ; display it
  73.    FIND S9 S1                                   ; compare for match
  74.    IF NOT FOUND                                 ; not found ?
  75.       GOTO SITITOUT                             ; wait some more
  76.    ENDIF
  77.  
  78. ;
  79. ; Call and execute named ASPECT file
  80. ;
  81.    CLEAR 30                                     ; clear the screen
  82.    EXECUTE S0                                   ; call the specified file
  83.